var person = {
  fullName: function () {
    return this;
  },
};
var person1 = {
  firstName: "Bill",
  lastName: "Gates",
};
var person2 = {
  firstName: "Steve",
  lastName: "Jobs",
};
var x = person.fullName.call(person1);

const str = "1,10:18:25:773,CAN1,Rx,18F0010B,CF FF 30 FF FF 0D FF FF\n";

const list = str.split(",");

list.map((e, index) => {
  if (e !== "Rx") {
    list[index] = e.toString().toLowerCase();
  }
});

list.splice(0, 1);

const nowDate =
  new Date().getTime() -
  new Date(
    new Date().getFullYear() +
      "-" +
      (new Date().getMonth() + 1) +
      "-" +
      new Date().getDate()
  ).getTime();

list[1] = list[1].replace("can", "");

[list[2], list[3]] = [list[3], list[2]];

list[2] += "x";

list.splice(4, 0, " d ");
list.splice(5, 0, " 8 ");

const newStr = list.join(" ");

function turnTime(str) {
  const list = str.split(":");

  const timeList = [1000 * 60 * 60, 1000 * 60, 1000, 1];

  const result = list.reduce((c, p, index) => c + p * timeList[index], 0);

  return result;
}
